import ballerina/io;
public function main() {
json given_object = {
"dsp": ["11:30", "5:15"],
"fmm": "5:15",
"svt": ["5:15", "2:00"],
"prg": ["8:30", "11:30"]
};
// Get search string
string search_string = io:readln("Subject: ");
// Get keys from JSON file
string[] keys = given_object.getKeys();
// Actually search for the right key
int j = 0;
boolean found = false;
while (j < keys.length()) {
if (search_string.equalsIgnoreCase(keys[j])) {
found = true;
io:println(given_object[keys[j]]);
}
j = j + 1;
}
// Say something if we didn't find it
if !(found) {
io:println("Key not found.");
}
}